<div id="operations">
<?php 
//print_r($currentObject);
?>

<?php 




//echo $currentObject->options_value;
$options=str_split($currentObject->operations);

$operation=array("List","Add","Edit","Delete","View","Filter","Copy");
$ops=array("L","A","C","D","V","F","P");
$i=0;
foreach ($operation as $op)
{
	$checked="";
	if (in_array($ops[$i], $options)) $checked="checked";
?>

<?=$op?> <input type="checkbox" name="operation" <?=$checked?> id="operations_<?=$op?>" value="<?=$ops[$i]?>" />

<script>
$('#operations_<?=$op?>').change(function () {
	str=$("#ButterflyPortal_data_OPERATIONS").val();
	value=$(this).attr("value");
	str=str.replace(value,"");
if($(this).is(":checked"))
{
	
	str=str+value;
	

}else{

	
}

$("#ButterflyPortal_data_OPERATIONS").val(str);
});
</script>
<?php
$i++;
}
?>
</div>
<script>

$("#ButterflyPortal_data_OPERATIONS").hide();

//$("#ButterflyPortal_data_OPTIONS").attr("type","hidden");
$("#el_OPERATIONS").append($("#operations"));


</script>
